<template>
	<view 
		class="big-box"  
		:style="{'min-height': minHeight}"
	>
		<taskScoreEnter :showTitle='false'/>
		<view v-if="dataList.length" class="item-box">
			<view class="top-title">
				学习记录
			</view>
			<view class="item-item-box" v-for="(item,index) in dataList" :key="index">
				<view class="time-top">
					<view class="time-top-left">
						{{item.date}}
					</view>
					<view class="time-top-right">
						+{{item.score_all}}
					</view>
				</view>
				<view class="item-item" v-for="(itm,idx) in item.data" :key="idx">
					<view class="item-item-info">
						{{itm.title}}
					</view>
					<view class="item-item-info">
						{{itm.get_score}}
					</view>
				</view>
				
			</view>
		</view>
		<view 
			v-else 
			style="margin-top: 50rpx;text-align: center;"
		>
			暂无学习记录
		</view>
	</view>
</template>

<script>
	import taskScoreEnter from '@/pagesB/pages/study/element/task-score-enter/index.vue'
	import allRequest from '@/pagesB/common/js/request/allRequest.js';
	export default {
		components: {
			taskScoreEnter
		},
		
		data() {
			return {
				minHeight:'',
				options:{},
				dataList:[]
			}
		},
		onLoad(options) {
			this.options = options
			uni.getSystemInfo({
				success: (res) => {
					this.minHeight = res.windowHeight + "px"
				}
			})
			allRequest.enterStudyRecord({
				data:{
					ag_project_id : this.options.ag_project_id
				},
				success:(res) => {
					this.dataList = res.list
				}
			})
		},
		methods: {
			
		}
	}
</script>

<style lang="less" scoped>
	.item-item-box{
		margin-top: 20rpx;
		box-sizing: border-box;
		padding: 32rpx 44rpx;
		background-color: #fff;
		border-radius: 18rpx;
	}
	.item-box{
		box-sizing: border-box;
		padding: 0 24rpx;
	}
	.top-title{
		margin: 38rpx 0;
		font-size: 32rpx;
		font-family: PingFangSC, PingFangSC-Medium;
		font-weight: blod;
		color: #262626;
	}
	.item-item-info{
		font-size: 26rpx;
		font-family: PingFangSC, PingFangSC-Regular;
		font-weight: 400;
		color: #7f7f7f;
		line-height: 36rpx;
	}
	.item-item{
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 18rpx;
	}
	.time-top-right{
		font-size: 26rpx;
		font-family: PingFangSC, PingFangSC-Medium;
		font-weight: 500;
		color: rgba(0,0,0,0.85);
	}
	.time-top-left{
		font-size: 30rpx;
		font-family: PingFangSC, PingFangSC-Medium;
		font-weight: 500;
		color: rgba(0,0,0,0.85);
	}
	.time-top{
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 30rpx;
	}
	.big-box{
		background-color:#f7f7f7;
		box-sizing: border-box;
	}
</style>
